package show.lmm.oauth2.resource.server.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import show.lmm.oauth2.resource.server.entity.UserInfo;

@RestController
@RequestMapping("/user_info")
@PreAuthorize("hasAuthority('SCOPE_message.read')")
public class  UserInfoController  {

    @GetMapping("/get")
    public UserInfo getUserInfo(@RequestParam("user_type")int userType) {
        UserInfo userInfo = new UserInfo();
        userInfo.setUsername("测试用户");
        userInfo.setUserType(userType);
        return userInfo;
    }
}
